<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:vm="clr-namespace:Explorer.Shared.ViewModels;assembly=Explorer.Shared.ViewModels"
			 xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
			 xmlns:ia="clr-namespace:Avalonia.Xaml.Interactions.Core;assembly=Avalonia.Xaml.Interactions"
			 xmlns:ui="clr-namespace:Explorer.Avalonia.UI;assembly=Explorer.Avalonia.UI"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="Explorer.Avalonia.UI.Views.MainView"
             x:DataType="vm:MainViewModel">

	<Grid>
		<TabControl ItemsSource="{Binding DirectoryTabItems}"
					SelectedItem="{Binding CurrentDirectoryTabItem}">
			<TabControl.Template>
				<ControlTemplate>
					<Border BorderBrush="{TemplateBinding BorderBrush}"
							BorderThickness="{TemplateBinding BorderThickness}"
							CornerRadius="{TemplateBinding CornerRadius}"
							Background="{TemplateBinding Background}"
							HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
							VerticalAlignment="{TemplateBinding VerticalAlignment}">
						<DockPanel>
							<StackPanel>
								<StackPanel Orientation="Horizontal">
									<ItemsPresenter Name="PART_ItemsPresenter"
													ItemsPanel="{TemplateBinding ItemsPanel}"
													DockPanel.Dock="{TemplateBinding TabStripPlacement}" />
									<Button Command="{Binding AddTabItemCommand}"
											Content="+"
											Height=""
											Width="{Binding $self.Bounds.Height}"/>
								</StackPanel>
								<ContentPresenter Name="PART_SelectedContentHost"
												  Margin="{TemplateBinding Padding}"
												  HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
												  VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
												  Content="{TemplateBinding SelectedContent}"
												  ContentTemplate="{TemplateBinding SelectedContentTemplate}" />
							</StackPanel>
						</DockPanel>
					</Border>
				</ControlTemplate>
			</TabControl.Template>
			<TabControl.ItemTemplate>
				<DataTemplate>
					<StackPanel Orientation="Horizontal">
						<TextBlock Text="{Binding Name}"/>
						<Button Command="{Binding CloseCommand}"
								Content="X"
								Width="{Binding $self.Bounds.Height}"/>
					</StackPanel>
				</DataTemplate>
			</TabControl.ItemTemplate>
			<TabControl.ContentTemplate>
				<DataTemplate>
					<ui:DirectoryTabItem />
				</DataTemplate>
			</TabControl.ContentTemplate>
		</TabControl>
	</Grid>
	
</UserControl>
